#pragma once

#include "game.h"

#include "finitestate.h"

class Game;

struct Player
{
public:

	V2D<int> m_position;
	FiniteState * m_state;

	char m_face;

	Game * g;

	int m_timer;

	const V2D<int> & getPosition()
	{
		return m_position;
	}

	void setPosition(V2D<int> a_position)
	{
		m_position = a_position;
	}

	Player():m_face(1),g(0){}

	Player(Game * g):m_face(1),g(g),m_timer(0){}

	Player(int x, int y):m_face(1),m_position(x, y){}

	void update(int a_ms)
	{
		m_timer += a_ms;
		if(m_timer > 1000)
		{
			m_timer -= 1000;
			if(m_state)
			{
				m_state->execute(this);
			}
		}
	}
};
